package com.java1412.user.controller;

import com.java1412.common.entity.User;
import com.java1412.user.service.UserService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author java1412
 * @since 2023-06-08 10:31:44
 */
@RestController
@RequestMapping("/api/v1/user")
public class UserController {
    @Resource
    private UserService userService;

    @RequestMapping("/{id}")
    public User findById(@PathVariable("id") Integer id) {
        User user = userService.findById(id);
        return user;
    }
}
